package com.zhejiangzhengyuan.municipal_common.entity.LED;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("singleton")
public class SendTextJson {

    public JSONObject senText;

    SendTextJson() {
        JSONObject result = new JSONObject();
        //封装Json
        result.put("playTimes", "0");
        result.put("playTimesFlag", "1");
        result.put("programId", "13");
        result.put("programName", "13");
        //封装pageResolution
        JSONObject resolution = new JSONObject();
        resolution.put("resolution", "1920X1080");
        JSONArray pageResolution = new JSONArray();
        pageResolution.add(resolution);
        result.put("pageResolution", pageResolution);
        //封装page
        JSONObject pageItem = new JSONObject();
        pageItem.put("name", "page1");
        pageItem.put("pagTime", 10);
        JSONArray pageEle = new JSONArray();
        JSONObject pageEleItem = new JSONObject();
        pageEleItem.put("bgColor", "");
        pageEleItem.put("bgImg", "");
        pageEleItem.put("bgName", "");
        pageEleItem.put("eqType", "x4");
        pageEleItem.put("pageTime", 10);
        pageEle.add(pageEleItem);
        JSONObject areaList = new JSONObject();
        areaList.put("pageEle", pageEle);
        //封装mediaEle
        JSONArray mediaEle = new JSONArray();
        JSONObject mediaEleItem = new JSONObject();
        mediaEleItem.put("background", "");
        mediaEleItem.put("borderEffect", 1);
        mediaEleItem.put("borderSW", 0);
        mediaEleItem.put("borderSpeed", 1);
        mediaEleItem.put("borderType", 1);
        mediaEleItem.put("edit", false);
        mediaEleItem.put("fontColor", "#00CD00");
        mediaEleItem.put("fontFamily", "黑体");
        mediaEleItem.put("fontSize", "28");
        mediaEleItem.put("fontStyle", "");
        mediaEleItem.put("fontWeight", "bold");
        mediaEleItem.put("height", 120);
        mediaEleItem.put("id", 4);
        mediaEleItem.put("left", 2);
        mediaEleItem.put("lineHeight", "30");
        mediaEleItem.put("listType", "");
        mediaEleItem.put("pauseTime", "5");
        mediaEleItem.put("scrollSpeed", "1");
        mediaEleItem.put("siderDirection", "0");
        mediaEleItem.put("siderType", "0");
        mediaEleItem.put("text", "请输入文字");
        mediaEleItem.put("textAlign", "center");
        mediaEleItem.put("textDecoration", "");
        mediaEleItem.put("textShow", "1");
        mediaEleItem.put("top", 0);
        mediaEleItem.put("type", 2);
        mediaEleItem.put("width", 240);
        mediaEleItem.put("zIndex", 0);
        JSONArray textGroup = new JSONArray();
        JSONObject textGroupItem = new JSONObject();
        textGroupItem.put("id", 1);
        textGroupItem.put("name", "字幕1");
        textGroupItem.put("text", "德清市政祝您出行顺利");
        textGroup.add(textGroupItem);
        mediaEleItem.put("textGroup", textGroup);
        mediaEle.add(mediaEleItem);
        areaList.put("mediaEle", mediaEle);
        pageItem.put("areaList", areaList);
        JSONArray page = new JSONArray();
        page.add(pageItem);
        result.put("page", page);

        senText = result;
    }

}
